﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LibSnesDotNet.Input
{
	public abstract class InputReceivedEventArgs : EventArgs
	{
		InputDriver _driver;
		Input _input;

		public InputDriver   Driver { get { return _driver; } }
		public Input Input { get { return _input; } }

		internal InputReceivedEventArgs(InputDriver driver, Input input)
		{
			_driver = driver;
			_input = input;
		}
	}

	public class DigitalInputReceivedEventArgs : InputReceivedEventArgs
	{
		bool _state;

		public bool State { get { return _state; } }

		internal DigitalInputReceivedEventArgs(InputDriver driver, Input input, bool state)
			: base(driver, input)
		{
			_state = state;
		}

	}

	public class LinearInputReceivedEventArgs<T> : InputReceivedEventArgs where T : struct
	{
		T _value;

		public T Value { get { return _value; } }

		internal LinearInputReceivedEventArgs(InputDriver driver, Input input, T value)
			: base(driver, input)
		{
			_value = value;
		}
	}

	public class PlanarInputReceivedEventArgs<T> : InputReceivedEventArgs where T : struct
	{
		T _x, _y;

		public T X { get { return _x; } }
		public T Y { get { return _y; } }

		internal PlanarInputReceivedEventArgs(InputDriver driver, Input input, T x, T y)
			: base(driver, input)
		{
			_x = x;
			_y = y;
		}
	}
}
